Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sign_raw() #50

Merged
merged 17 commits into from
Sep 6, 2023
Merged

Add sign_raw() #50

merged 17 commits into from
Sep 6, 2023

Conversation

MHHukiewitz
Copy link
Member

BaseAccount.sign_raw() accepts raw bytes and outputs a signature as a string in the preferred encoding.

This allows signing of arbitrary data besides Aleph messages, making it a useful tool in dApp development.

@MHHukiewitz
Copy link
Member Author

Relies on #49

@hoh
Copy link
Member

hoh commented Aug 16, 2023

The diff looks good to me. Do we have any test on the new sign_raw method ?

@hoh
Copy link
Member

hoh commented Aug 16, 2023

Relies on #49

Squashed and pushed on master. Can you rebase on it ?

@hoh
Copy link
Member

hoh commented Aug 17, 2023

As discussed, sign_raw should return Bytes. The rest looks good to me.

@MHHukiewitz
Copy link
Member Author

After suggestion by @hoh I changed the signature of sign_raw(buffer: bytes) -> str: to sign_raw(buffer: bytes) -> bytes:.

As this involves a bit more invasive refactoring, I decided that it would only make sense to add more unit tests, especially to the non-existent Cosmos and Substrate (Polkadot) tests.

src/aleph/sdk/chains/nuls1.py Show resolved Hide resolved
src/aleph/sdk/chains/substrate.py Show resolved Hide resolved
src/aleph/sdk/chains/substrate.py Outdated Show resolved Hide resolved
src/aleph/sdk/chains/substrate.py Outdated Show resolved Hide resolved
@odesenfans odesenfans merged commit 3b9885a into main Sep 6, 2023
10 checks passed
@MHHukiewitz MHHukiewitz deleted the mhh-sign-raw branch September 6, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants